/* 
 * Copyright 2011 kOSMik.
 * This file is part of kOSMik.
 * 
 * kOSMik is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * kOSMik is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with kOSMik.  If not, see <http://www.gnu.org/licenses/>.
 *  
 * kOSMik:
 * Open Street Map - Editor.
 * http://code.google.com/p/swp-dv-ws2010-osm-2/
 */

package de.fuberlin.kosmik.data.dao;

import android.os.Bundle;

/**
 * This is a DAO Object which represents a Way entity in the data base. This is
 * merely used as a data bean and any changes done on it's attribute will have
 * no effect on the data base. Since all attributes are final, they are also not
 * supposed to be changed.
 * 
 * @author Amit
 * 
 */
public class Way {

	/**
	 * Timestamp in ms resolution.
	 */
	public long timestamp;

	/**
	 * Data base id of the track this way belongs to.
	 */
	public final long trackId;

	/**
	 * Data base id of this way.
	 */
	public final long wayId;

	/**
	 * True for closed areas such as buildings, lakes, parks etc.
	 */
	public final boolean isArea;

	/**
	 * An android {@link Bundle} which contains the tags which belongs to this
	 * way.
	 */
	public final Bundle tags;

	/**
	 * Constructor for this Way DAO Object.
	 * 
	 * @param wayId data base id for this way
	 * @param trackId data base id for the track of this way
	 * @param isArea true if this is a closed area
	 */
	public Way(long wayId, long trackId, boolean isArea) {
		this.trackId = trackId;
		this.wayId = wayId;
		this.isArea = isArea;
		this.tags = new Bundle();
	}

	/**
	 * Put a tag (key and value) onto the Way data object.
	 * 
	 * @param key String key of tag
	 * @param value String value of tag
	 */
	public void putTag(String key, String value) {
		tags.putString(key, value);
	}
}
